;(function($){
    $('.move_box').css('marginLeft','0');
    //下一页按钮事件
    $('.mr').on('click',function(){
        var $move_box = $(this).parent().children('.move_box');
        var left = parseInt($move_box.css('marginLeft'));
        var $dl = $move_box.children('dl');
        var dls = 0;
        $dl.each(function(){
            dls += 1;
        })
        var counts = Math.ceil(dls/4)-1;
        // console.log(counts);
        if(left > -counts*856){
            left = left - 856;
            $move_box.animate({
                marginLeft: left+"px"
            },500)
        }
    })
    //上一页按钮事件
    $('.ml').on('click',function(){
        var $move_box = $(this).parent().children('.move_box');
        var left = parseInt($move_box.css('marginLeft'));
        var $dl = $move_box.children('dl');
        var dls = 0;
        $dl.each(function(){
            dls += 1;
        })
        var counts = Math.ceil(dls/4)-1;
        // console.log(counts);
        if(left < 0){
            left = left+856;
            $move_box.animate({
                marginLeft: left+"px"
            },500)
        }
    })
}(jQuery))